/*
 * Copyright 2012 Biz-e (info@biz-e.nl)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package nl.biz_e.android.calllog.model;

/**
 * Represents an item in the Logged Items database
 * 
 * @author Joost A. Bloemsma
 */
public class StoredLogItem {
	private Long rowId;
    private String itemId;
    private Long calId;
    private Long eventId;
    private String notes;
    private int inCalendar = 0;
    
    /**
     * Constructs a new StoredLogItem instance
     */
    public StoredLogItem() {
    	this(null, null);
    }
    
    /**
     * Constructs a new StoredLogItem instance and sets the ItemId and Calendar ID, thus the primary key
     * @param itemId
     * @param calId
     */
    public StoredLogItem(String itemId, Long calId) {
    	this(null, itemId, calId, null);
    }

    /**
     * Constructs a new StoredLogItem instance and sets the primary key (itemId, calendarId) and the EventId 
     * that was generated when it was stored in the calendar
     * @param itemId
     * @param calId
     * @param eventId
     */
    public StoredLogItem(String itemId, Long calId, Long eventId) {
    	this(null, itemId, calId, eventId);
    }
    
    /**
     * Constructs a new StoredLogItem instance from all data in a row
     * @param rowId
     * @param itemId
     * @param calId
     * @param eventId
     */
    public StoredLogItem(Long rowId, String itemId, Long calId, Long eventId) {
    	this(rowId, itemId, calId, eventId, null);
    }
    
    /**
     * Constructs a new StoredLogItem instance.<br/>
     * Like {@link #StoredLogItem(String, Long, Long)} but with notes
     * @param itemId
     * @param calId
     * @param eventId
     * @param notes
     */
    public StoredLogItem(String itemId, Long calId, Long eventId, String notes) {
    	this(null, itemId, calId, eventId, null);
    }
    
    /**
     * Constructs a new StoredLogItem instance.<br/>
     * Like {@link #StoredLogItem(String, Long, Long, String)} but with notes
     * @param rowId
     * @param itemId
     * @param calId
     * @param eventId
     * @param notes
     */
    public StoredLogItem(Long rowId, String itemId, Long calId, Long eventId, String notes) {
    	super();
    	this.setRowId(rowId);
    	this.setItemId(itemId);
    	this.setCalId(calId);
    	this.setEventId(eventId);
    }

	/**
	 * @return the rowId
	 */
	public Long getRowId() {
		return rowId;
	}

	/**
	 * @param rowId the rowId to set
	 */
	public void setRowId(Long rowId) {
		this.rowId = rowId;
	}

	/**
	 * @return the itemId
	 */
	public String getItemId() {
		return itemId;
	}

	/**
	 * @param itemId the itemId to set
	 */
	public void setItemId(String itemId) {
		this.itemId = itemId;
	}

	/**
	 * @return the calId
	 */
	public Long getCalId() {
		return calId;
	}

	/**
	 * @param calId the calId to set
	 */
	public void setCalId(Long calId) {
		this.calId = calId;
	}

	/**
	 * @return the eventId
	 */
	public Long getEventId() {
		return eventId;
	}

	/**
	 * @param eventId the eventId to set
	 */
	public void setEventId(Long eventId) {
		this.eventId = eventId;
	}

	/**
	 * @return the notes
	 */
	public String getNotes() {
		return notes==null? "" : notes ;
	}

	/**
	 * @param notes the notes to set
	 */
	public void setNotes(String notes) {
		this.notes = notes;
	}

	/**
	 * @return the inCalendar
	 */
	public int getInCalendar() {
		return inCalendar;
	}

	/**
	 * @param inCalendar the inCalendar to set
	 */
	public void setInCalendar(int inCalendar) {
		this.inCalendar = inCalendar;
	}

	
}

